﻿using System.Collections.Generic;
using System.Configuration;
using Red.Controls;
using Red.Controls.Shell;
using Packages = Red.Launcher.ViewModels.Packages;
using Workspaces = Red.Launcher.ViewModels.Workspaces;

namespace Red.Launcher
{
    public class UserSettings : RedSettings
    {
        [UserScopedSetting]
        [DefaultSettingValue( "-1" )]
        public int ActiveToolkitBuildId
        {
            get { return GetValue<int>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( "-1" )]
        public int ActiveEngineBuildId
        {
            get { return GetValue<int>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( "-1" )]
        public int ActiveEditorBuildId
        {
            get { return GetValue<int>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( "" )]
        public string ActiveWorkspace
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"%AppData%\CD Projekt Red\Red Toolkit\Managed\" )]
        public string ToolkitPackagesInstallationDirectory
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"$BestGuessDrive$\Red Engine\Managed\" )]
        public string EnginePackagesInstallationDirectory
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"$BestGuessDrive$\Perforce\" )]
        public string WorkspaceInstallationDirectory
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"%AppData%\CD Projekt Red\Red Editor\Managed\" )]
        public string EditorPackagesInstallationDirectory
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"CDPRS-MSSQL\sqlexpress" )]
        public string DatabaseServer
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"Workspaces" )]
        public string DatabaseName
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"perforce" )]
        public string PerforceServerAddress
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"1666" )]
        public ushort PerforceServerPort
        {
            get { return GetValue<ushort>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"BaseDark" )]
        public string Theme
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"Crimson" )]
        public string Accent
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"" )]
        public List<string> LauncherTileLayout
        {
            get { return GetValue<List<string>>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"True" )]
        public bool DisplayRecentFilesByDefault
        {
            get { return GetValue<bool>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"" )]
        public LauncherWindowSettings.Settings LauncherWindowSettings
        {
            get { return GetValue<LauncherWindowSettings.Settings>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public LauncherWindowData.AppConfig LauncherConfig
        {
            get { return GetValue<LauncherWindowData.AppConfig>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public Packages.AppConfig ToolkitPackageConfig
        {
            get { return GetValue<Packages.AppConfig>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public Packages.AppConfig EditorPackageConfig
        {
            get { return GetValue<Packages.AppConfig>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public Packages.AppConfig EnginePackageConfig
        {
            get { return GetValue<Packages.AppConfig>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public Workspaces.AppConfig WorkspacesConfig
        {
            get { return GetValue<Workspaces.AppConfig>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public string ProcessMonitorXml
        {
            get { return GetValue<string>(); }
            set { SetValue( value ); }
        }

        [UserScopedSetting]
        [DefaultSettingValue( @"True" )]
        public bool IsLogoLarge
        {
            get { return GetValue<bool>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public LogoSpecs LogoLarge
        {
            get { return GetValue<LogoSpecs>(); }
            set { SetValue( value ); }
        }

        [ApplicationScopedSetting]
        public LogoSpecs LogoSmall
        {
            get { return GetValue<LogoSpecs>(); }
            set { SetValue( value ); }
        }
    }
}
